#include <unordered_map>
#include <vector>

using namespace std;

class Solution {
public:
    int repeatedNTimes(vector<int>& nums) 
    {
        unordered_map<int, int> m;
        for (auto e : nums)
        {
            if (m.find(e) != m.end())
            {
                ++m[e];
            }
            else
            {
                m.insert({e, 1});
            }
        }

        int num = nums.size() / 2;
        for (auto e : m)
        {
            if (e.second == num)
            {
                return e.second;
            }
        }
        return 0;
    }
};